package com.yanqu.road.server.cmd.cross.tradewar;

import com.yanqu.road.entity.tradewar.TradeWarWanted;
import com.yanqu.road.logic.pb.TradeWarPb;
import com.yanqu.road.pb.tradewar.TradeWarProto;
import com.yanqu.road.server.cmd.base.AbstractServerCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manger.activity.TradeWarActivityMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;


@Cmd(code = Protocol.S_CROSS_TRADE_WAR_WANTED_NOTIFY, desc = "跨服商战通缉通知")
public class CrossTradeWarPublishWantedNotifyCmd extends AbstractServerCommand {
	private TradeWarWanted tradeWarWanted;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		TradeWarProto.TradeWarWantedTempMsg reqMsg = TradeWarProto.TradeWarWantedTempMsg.parseFrom(packet.getBytes());
		tradeWarWanted = TradeWarPb.parseTradeWarWanted(reqMsg);
		return true;
	}

	@Override
	public void execute(YanQuMessage packet) throws Exception {
		//被通缉处理
		TradeWarActivityMgr.dealBeCrossWanted(tradeWarWanted);
		//全服通知
		TradeWarActivityMgr.worldNotifyCrossWanted(tradeWarWanted);
	}

	@Override
	public void sendData(YanQuMessage packet) throws Exception {

	}

}
